0<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>功能信息</title>

<style type="text/css">
.by {
	padding: 10px;
}

.line {
	margin-top: 10px;
}
</style>

<link rel="shortcut icon"
	href="<c:url value="/easyui/css/images/favicon.ico"/>" />
<link rel="stylesheet" href="<c:url value="/css/flipclock.css"/>">
<link href="<c:url value="/css/CalcSS3.css"/>" rel="stylesheet"
	type="text/css" />
<link href="<c:url value="/css/index.css"/>" rel="stylesheet"
	type="text/css" />
<link href="<c:url value="/easyui/css/easyui.css"/>" rel="stylesheet"
	type="text/css">
<link href="<c:url value="/easyui/css/easyui_animation.css"/>"
	rel="stylesheet" type="text/css">

<link href="<c:url value="/easyui/css/easyui_plus.css" />"
	rel="stylesheet" type="text/css">
<link href="<c:url value="/easyui/css/insdep_theme_default.css" />"
	rel="stylesheet" type="text/css">
<link href="<c:url value="/easyui/css/icon.css" />" rel="stylesheet"
	type="text/css">
<link
	href="<c:url value="/easyui/css/font-awesome-4.7.0/css/font-awesome.min.css" />"
	rel="stylesheet" type="text/css">
<!-- 引入 ECharts 文件 -->
<script type="text/javascript" src="<c:url value="/js/echarts.js"/>"></script>
<!--放入自定义的图表-->

<script type="text/javascript" src="<c:url value="/js/monitor.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/easyui/js/jquery.min.js"/>"></script>
<%--<script type="text/javascript" src="js/jquery.js"></script>--%>
<script type="text/javascript"
	src="<c:url value="/easyui/js/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/easyui/js/jquery.insdep-extend.min.js"/>">
	
</script>

</head>
<body>
	<script type="text/javascript">
		$(function() {
			$("#append-menubar").linkbutton({
				onClick : function() {
					$("#yk-append-menubar").dialog("open");
				}
			});
			
			$("#yk-menubar-table").datagrid({
		         onBeforeSelect: function(index,row){
		             var row =$("#yk-menubar-table").datagrid("getSelected");
		             var curRowindex = $("#yk-menubar-table").datagrid("getRowIndex",row);
		             if(curRowindex != index) {return true;}
		             else{ $("#yk-menubar-table").datagrid("unselectRow",index); return false;}
		         } 
			 });	
		});
		
	</script>
	<table id="yk-menubar-table" class="easyui-datagrid"
		data-options="
	       fit:true,fitColumns:true, autoRowHeight:true,nowrap:false,rownumbers:true,
	           striped:true,singleSelect:true,toolbar:'#yk-menubar-control',
	           url:'query-All-Menubars',method:'post', 
	           pagination:true,pageList:[5,10,15,20,25],pageSize:10
	       ">
		<thead>
			<tr>
				<th data-options="field:'checkbox',checkbox:true,width:20"></th>
				<th data-options="field:'id',width:20">功能ID</th>
				<th data-options="field:'text',width:30">功能名称</th>
			</tr>
		</thead>
		<tbody>

		</tbody>
	</table>

	<div id="yk-menubar-control">
		<span><a id="append-menubar" class="easyui-linkbutton"
			data-options="iconCls:'icon-add'">添加功能</a> </span>
	</div>

	<div id="yk-append-menubar" class="easyui-dialog"
		data-options="title:'添加功能',width:500,height:150,closed:true,
	            bodyCls:'by',buttons:[{
				text:'保存',
				iconCls:'icon-ok',
				handler:function(){
				   $('#yk-menubar-f').form({
				        onSubmit:function(params){
				           return $(this).form('validate');
				        },
				        success:function(r){
				        r = eval('(' + r + ')');
				        if(r.success){
				            $('#yk-append-menubar').window('close');
				           $('#yk-menubar-table').datagrid('reload');
				           $.messager.alert('提示', '添加成功！');
				        }else{
				           $('#yk-append-menubar').window('close');
				           $.messager.alert('提示', r.message);
				        }
				        }
				   }).submit();
				}
			},{
				text:'关闭',
				iconCls:'icon-cancel',
				handler:function(){
				$('#yk-append-menubar').window('close');
				}
			}],
			onOpen:function(){
			  $('#yk-menubar-f').form('clear');
			}">
		<form id="yk-menubar-f" method="post" action="add-One-Menubar">
			<div class="line">
				<input name="text" class="easyui-textbox"
					data-options="required:true, label:'功能名称：', width:450">
			</div>
		</form>
	</div>
</body>
</html>